/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package visao;

import java.awt.Image;
import java.awt.Toolkit;
import java.util.ArrayList;
import negocio.ControleBanco;
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Daniel
 */
public class JFInicial extends javax.swing.JFrame {
    static Collections col;
    /**
     * Creates new form NewJFrame
     */
    public JFInicial() {
        initComponents();       
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @Override
    public Image getIconImage(){
        Image retValue = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("icones/foot.png"));
        return retValue;
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jBInicio = new javax.swing.JButton();
        jBSobre = new javax.swing.JButton();
        jBSair = new javax.swing.JButton();
        jBDesenvolvedor = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Foot Project");
        setBackground(new java.awt.Color(0, 153, 51));
        setIconImage(getIconImage());
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jBInicio.setBackground(new java.awt.Color(0, 102, 0));
        jBInicio.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jBInicio.setForeground(new java.awt.Color(255, 255, 255));
        jBInicio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icones/foot.png"))); // NOI18N
        jBInicio.setText("   Início");
        jBInicio.setBorder(null);
        jBInicio.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jBInicio.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jBInicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBInicioActionPerformed(evt);
            }
        });
        getContentPane().add(jBInicio, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 170, 170, 35));

        jBSobre.setBackground(new java.awt.Color(0, 102, 0));
        jBSobre.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jBSobre.setForeground(new java.awt.Color(255, 255, 255));
        jBSobre.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icones/Sobre.png"))); // NOI18N
        jBSobre.setText("    Sobre");
        jBSobre.setBorder(null);
        jBSobre.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jBSobre.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jBSobre.setMargin(new java.awt.Insets(0, 0, 0, 0));
        jBSobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBSobreActionPerformed(evt);
            }
        });
        getContentPane().add(jBSobre, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 30, 170, 35));

        jBSair.setBackground(new java.awt.Color(0, 102, 0));
        jBSair.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jBSair.setForeground(new java.awt.Color(255, 255, 255));
        jBSair.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icones/Sair.png"))); // NOI18N
        jBSair.setText("     Sair");
        jBSair.setBorder(null);
        jBSair.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jBSair.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jBSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBSairActionPerformed(evt);
            }
        });
        getContentPane().add(jBSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 320, 170, 35));

        jBDesenvolvedor.setBackground(new java.awt.Color(0, 102, 0));
        jBDesenvolvedor.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jBDesenvolvedor.setForeground(new java.awt.Color(255, 255, 255));
        jBDesenvolvedor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icones/Desenvolvedor.png"))); // NOI18N
        jBDesenvolvedor.setText("Desenvolvedor");
        jBDesenvolvedor.setBorder(null);
        jBDesenvolvedor.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jBDesenvolvedor.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        jBDesenvolvedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBDesenvolvedorActionPerformed(evt);
            }
        });
        getContentPane().add(jBDesenvolvedor, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 170, 170, 35));

        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 150, 113, 88));

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icones/TelaInicial.png"))); // NOI18N
        jLabel2.setText("jLabel2");
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 600, 400));

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-616)/2, (screenSize.height-438)/2, 616, 438);
    }// </editor-fold>//GEN-END:initComponents

    private void jBDesenvolvedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBDesenvolvedorActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jBDesenvolvedorActionPerformed

    private void jBSobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSobreActionPerformed
        JFSobre sobre = new JFSobre();
        sobre.setVisible(true);
    }//GEN-LAST:event_jBSobreActionPerformed

    private void jBInicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBInicioActionPerformed
        JFPesquisa pesquisa = new JFPesquisa();
        pesquisa.setVisible(true);
        try {
            initComponents();
            ControleBanco banco = new ControleBanco();
            ArrayList buscaListaJog = banco.buscaListaJog();
            col.sort(buscaListaJog);
            pesquisa.jComboBox1.removeAllItems();
            for (int i = 0; i<buscaListaJog.size(); i++) {
                pesquisa.jComboBox1.addItem(buscaListaJog.get(i));
            }
        } catch (Exception ex) {
            Logger.getLogger(JFPesquisa.class.getName()).log(Level.SEVERE, null, ex);
        }
        this.dispose();
    }//GEN-LAST:event_jBInicioActionPerformed

    private void jBSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBSairActionPerformed
        this.dispose();
    }//GEN-LAST:event_jBSairActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JFInicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JFInicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JFInicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JFInicial.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JFInicial().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jBDesenvolvedor;
    private javax.swing.JButton jBInicio;
    private javax.swing.JButton jBSair;
    private javax.swing.JButton jBSobre;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    // End of variables declaration//GEN-END:variables
}
